package fr.afcepf.ai89.esharing.data;

import java.util.List;

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;

import fr.afcepf.ai89.esharing.entity.Complement;
import fr.afcepf.ai89.esharing.entity.NoteAvis;

@Stateless
public class DAONoteAvis implements IDAONoteAvis {

	@PersistenceContext(unitName = "ESharingPhase22")
	EntityManager em;

	@Override
	public NoteAvis getNoteAvis(int idNoteAvis) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<NoteAvis> getNotesAvis() {
		
		Query hql = em.createQuery("SELECT n from NoteAvis n");

		List<NoteAvis> notes = (List<NoteAvis>)hql.getResultList();

		return notes;
		
	}

	@Override
	public int addNoteAvis(NoteAvis noteAvis) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int majNoteAvis(NoteAvis noteAvis) {
		// TODO Auto-generated method stub
		return 0;
	}

}
